#include "ibmsgv_api.h"
//#include "IBstructData.h"
#include "Save_Business.h"
#include "ibmsgv_api.h"

static int ib1_test_echo(char *cServerNode)
{
        int iret = 0;
	char cTranCode[12 + 1];
	Save_Business sb;

	memset(cTranCode, 0x00, sizeof(cTranCode));
	memset(&sb, 0x00, sizeof(Save_Business));

        //strcpy(cServerNode, "baojiaqi_server");
        strcpy(cTranCode, "0000");
        strcpy(cTranCode + 4, "testbjq");
	strcpy(sb.card_no, "1234");
	
        iret = IBMSGVCall_DEF(NULL, cServerNode, cTranCode, &sb, &ABRCP_pkg_Save_Business
			, &sb, &ABRCP_pkg_Save_Business, NULL, NULL);
        if(iret)
        {
                printf("IBMSGVCall failed[%d], errno[%d]\n", iret, errno);
                return -1;
        }
        else
        {
                printf("IBMSGVCall ok\n");
        }

        return 0;
}
static void usage()
{
        printf("USAGE : ib1_test_echo node\n");
        return;
}

int main(int argc, char *argv[])
{
        int iret = 0 ;

        if(argc == 1 + 1)
        {
                IBPInitLogEnv("", "client", "file::log/event.log", LOG_LEVEL_DEBUG, "file::log/ib1_test_client_ib1.log");
                iret = ib1_test_echo(argv[1]);
                IBPCleanLogEnv();
                return -iret;
        }
        else
        {
                usage();
                exit(7);
        }
}
